import request from '@/utils/request'
// 组织架构-查询企业的部门列表
export const getDepts = () => {
  return request({
    url: '/company/department'
  })
}

export const getDepartments = () => {
  return request({
    url: '/company/department'
  })
}

// 组织架构-根据ID删除部门
export const delDepts = id => {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

// 组织架构-新增部门
export const addDepts = data => {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 组织架构-根据ID查询部门详情
export const deptsDetail = id => {
  return request({
    url: `/company/department/${id}`
  })
}

// 组织架构-根据ID修改部门详情
export const editDepts = data => {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
